home *** CD-ROM | disk | FTP | other *** search
Wrap
head 1.2; branch ; access ; symbols beta10:1.1; locks death:1.2; comment @@; 1.2 date 93.04.04.23.45.22; author death; state Exp; branches ; next 1.1; 1.1 date 93.01.10.15.08.51; author death; state Exp; branches ; next ; desc @@ 1.2 log @Sun Apr 4 23:45:22 PDT 1993 @ text @/*==================================================================== This is the implementation file for the TextConverter class. Full documentation for this class can be found in the TextConverter.rtf file. I will not duplicate all that fine information here. NOTE: You may find that text doesn't line up properly unless you use the New Century Schoolbook Roman typeface, since this was created with it. INFORMATION: This is $Revision: 1.1 $ of this file It was last modified by $Author: death $ on $Date: 93/01/10 15:08:51 $ $Log: TextConverter.m,v $ Revision 1.1 93/01/10 15:08:51 death Sun Jan 10 15:08:51 PST 1993 ====================================================================*/ #import "TextConverter.h" #import <string.h> // for memcpy @@implementation TextConverter ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Routine: ConvertCharacter: // Parameters: a character to be converted // Returns: the converted character // Stores: the character that we are returning. // Description: // This merely returns the chracter that we were passed, thus providing the // trivial text conversion algorithm (everything maps to itself) // Bugs: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - (Character) ConvertCharacter: (Character) theCharacter { [self ResetResults]; [self StoreErrorCode: errOK AndText: "Of course nothing went wrong!"]; [self StoreCharacter: theCharacter]; return theCharacter; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Routine: ConvertString:WithLength: // Parameters: a pointer to a string of data to be converted // the length of the data the poiner poins to. // Returns: a poiner to a new block of data to be converted // Stores: the pointer we are returning // the length of the new data // Description: // This converts the text in the source data area into a new area. // As with ConvertCharacter:, this really just returns to the caller exactly what // it passed us. // Bugs: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - (Pointer) ConvertString: (Pointer) theData WithLength: (Integer) length { Pointer newData; [self ResetResults]; newData = NewPointer(length); memcpy(newData, theData, length); [self StoreErrorCode: errOK AndText: "Of course nothing went wrong!"]; [self StorePointer: theData]; [self PutPositiveInteger: length Into: SECOND_RESULT]; return theData; } @@end @ 1.1 log @Sun Jan 10 15:08:51 PST 1993 @ text @d7 6 a12 3 This is $Revision: 1.4 $ of this file It was last modified by $Author: death $ on $Date: 92/04/05 22:51:36 $ $Log: $ @